<?php
/**
 * The world of warcraft armory library was created by Marc Binder. The called
 * product will be deployed by Tof Technologies, Germany. All sources contain to 
 * the New BSD Licence. Self created extensions can be contained in the hall of 
 * fame. So the community has the chance to get a overview of all parsers and
 * handlers, which are really effective.
 * 
 * Get more informations:
 * http://code.google.com/p/warcraftarmory/
 * 
 * @author      Marc Binder <marcandrebinder@gmail.com>
 * @copyright   (c) Tof Technologies, Germany - 2010
 * @license     New BSD Licence
 * @package     Wow_Armory
 * @version     $Id$
 */

/**
 * Wow_Armory_Realm
 * 
 * @category    Wow_Armory
 * @package     Realm
 * @subpackage  -
 * @example     n/A
 */
class Wow_Armory_Realm
{

    /**
     * Contains the realm name as a string.
     * 
     * @var string
     */
    protected $_realmName = null;
    
    /**
     * Creates the object.
     * 
     * @throws Wow_Armory_Exception '' - 1013
     * @param  string $realm
     * @return void
     */
    public function __construct($realm)
    {
        if (!is_string($realm)
            || empty($realm)
        ) {
            throw new Wow_Armory_Exception('', 1013);
        }
        
        $this->_realmName = $realm;
    }
    
    /**
     * Returns the realm name as a string.
     * 
     * @return string
     */
    public function getRealmName()
    {
        return $this->_realmName;
    }
    
    /**
     * Gets the parsed realm name.
     * 
     * @return string
     */
    public function getRealmNameParsed()
    {
        return str_replace(' ', '+', $this->_realmName);
    }
    
}